﻿using System;
using Autodesk.Revit.DB;

namespace YJKRevitKernel.ElementFilterUtility
{
	public abstract class BaseFamilyInstanceFilter : BaseFilter<FamilyInstance>
	{
		public override bool AllowElement(Element elem)
		{
			if (!base.AllowElement(elem))
			{
				return false;
			}
			bool result;
			try
			{
                result = (elem.Category.Id.IntegerValue == (int)this.m_useCategory);
			}
			catch (Exception)
			{
				result = false;
			}
			return result;
		}

		protected BuiltInCategory m_useCategory;
	}
}
